{block name=report-classes}
<div class="row">
  <div class="col-sm-12">
    <a href="javascript:void(0);" onClick="exportPageToCSV($(this),$('#print-classlist'),'classlist.csv');" class="btn btn-info report-green"><span>Export CSV</span></a>
  </div>
</div>
<div class="row form">
  <div class="col-sm-12">
    <a href="javascript:void(0);" onClick="printArea('print-classlist');" class="btn btn-info report-green"><span>Print</span></a>
  </div>
</div>
<div id="print-classlist">
	{foreach $classterms as $term}
	<div class="row term">
	  <div class="col-sm-12">
	    <h2 class="title">{$term.term_name} - {$term.term_region}<!-- {$ct.agegroup_name} | {$ct.class_start_time|date_format:"%H:%M %p"} - {$ct.class_end_time|date_format:"%H:%M %p"} | {$ct.location_suburb}, {$ct.location_state} --></h2>
	  </div>{foreach $term.locations as $loc}
	  {foreach $loc.classes as $ct}
	  <div class="location">
		<div class="col-sm-12">
			<h3 class="title">{$ct.class_name} - {$ct.agegroup_name} <!-- {$ct.agegroup_name} | {$ct.class_start_time|date_format:"%H:%M %p"} - {$ct.class_end_time|date_format:"%H:%M %p"} | {$ct.location_suburb}, {$ct.location_state} --></h3>
			<span class="pull-right">{if !empty($ct.students[0])}{assign var='cnt' value=0}{foreach $ct.students as $st}{if $st.enrolment_type eq 'W'}{break}{/if}{assign var='cnt' value=$cnt+1}{/foreach}{$cnt}{else}0{/if}/{$ct.class_size}</span> 
		</div>
		<div class="col-sm-12">
			<table class="table table-striped lblue">
				<thead>
					<th>Student Name</th>
					<th>Student DOB</th>
					<th>Parent Name</th>
					<th>Parent Surname</th>
					<th>Phone</th>
					<th>Email</th>
					<th>Enrolment Type</th>
					<th>Status</th>
				</thead>
				<tbody>
					{foreach $ct.students as $student}
						<tr>
							<td{if $student.trial_past} style="background-color: rgba(255,0,0,0.25);"{/if}>{$student.student_name} {$student.student_surname}</td>
							<td{if $student.trial_past} style="background-color: rgba(255,0,0,0.25);"{/if}>{$student.student_dob}</td>
							<td{if $student.trial_past} style="background-color: rgba(255,0,0,0.25);"{/if}>{$student.user_gname}</td>
							<td{if $student.trial_past} style="background-color: rgba(255,0,0,0.25);"{/if}>{$student.user_surname}</td>
							<td{if $student.trial_past} style="background-color: rgba(255,0,0,0.25);"{/if}>{$student.address_telephone}</td>
							<td{if $student.trial_past} style="background-color: rgba(255,0,0,0.25);"{/if}>{$student.user_email}</td>
							<td{if $student.trial_past} style="background-color: rgba(255,0,0,0.25);"{/if}>{$student.enrolment_type}{if $student.enrolment_type eq 'T' || $student.enrolment_type eq 'MK'} <span class="small">[{getdatebyweekdaystartdate weekday=$ct.class_weekday startdate=$term.term_start_date weeksafter=$student.enrolment_week-1 dateformat='d/m/Y'}]</span>{/if}</td>
							<td{if $student.trial_past} style="background-color: rgba(255,0,0,0.25);"{/if}>{$student.status_name}</td>
						</tr>
					{/foreach}
				</tbody>
			</table>
		</div></div>
		{/foreach}{/foreach}
	</div>
	{/foreach}
</div>
{/block} 


